package com.vcs.frm.dao.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.vcs.frm.domain.Teacher;

public class TeacherRowMapper implements RowMapper<Teacher> {
	@Override
	public Teacher mapRow(ResultSet rs, int rowNum) throws SQLException {
		Teacher t = new Teacher();
		t.setTeacherId(rs.getInt("TEACHER_ID"));
		t.setFirstName(rs.getString("TEACHER_FIRST_NAME"));
		t.setMiddleName(rs.getString("TEACHER_MIDDLE_NAME"));
		t.setLastName(rs.getString("TEACHER_LAST_NAME"));
		t.setQualifications(rs.getString("QUALIFICATIONS"));
		t.setSpecialCourses(rs.getString("SPECIAL_COURSES"));
		t.setDesignation(rs.getString("DESIGNATION"));
		t.setDesignationCode(rs.getInt("DESIGNATION_CODE"));
		t.setDateOfJoining(rs.getDate("DATE_OF_JOINING"));
		return t;
	}
}
